import java.awt.*;
/**
 * Write a description of class Numbers here.
 * 
 * @author Kathleen, Kyle, Jsh, Dustin
 * @version 3/21/13
 */
public class NumberBlock
{
    private static final int SIZE = 50;
    private int x, y, num;
    private String value;
    

    /**
     * Constructor for objects of class Numbers
     */
    public NumberBlock(Graphics g, int x, int y, int num )
    {
        this.x = x;
        this.y = y;
        this.num = num;

        g.setColor(Color.BLUE);
        g.drawRect(x, y, SIZE, SIZE);
        g.setColor(Color.ORANGE);
        this.value = Integer.toString(num);

        g.drawString(this.value, x +15 , y + 38); 
    }

    /**
     * Returns this number block's value.
     * @return The value contained by this numberblock.
     */
    public int getValue() { return this.num; }

    public boolean contains(int xPos, int yPos)
    {

        if ((xPos >= x) && (xPos <= x+SIZE) 
        && (yPos >= y) && (yPos <= y+SIZE)){
            return true;
        }
        return false;

    }

    public void clear(Graphics g)
    {
        this.value = "";
        g.setColor(Color.WHITE);
        g.drawRect(x, y, SIZE, SIZE);
        
    }
}
